-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RateLimit.Conditions
need explicit scope
#1145
Conversation
With Limitador v2.0, conditions need to specify where the variables are to be looked up. Variables coming from the envoy RLP are populated in the `descriptors` root binding. While the protocol allows for multiple descriptors (each with multiple entries), the wasm-shim will only ever use the first one, i.e. index 0. Signed-off-by: Alex Snaps <alex@wcgw.dev>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1145 +/- ##
==========================================
+ Coverage 83.33% 83.37% +0.04%
==========================================
Files 81 81
Lines 6943 6943
==========================================
+ Hits 5786 5789 +3
+ Misses 930 928 -2
+ Partials 227 226 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Sorry Codecov, but you're on crack! |
@@ -124,7 +124,7 @@ func (r *LimitadorLimitsReconciler) buildLimitadorLimits(ctx context.Context, st | |||
Namespace: limitsNamespace, | |||
MaxValue: maxValue, | |||
Seconds: seconds, | |||
Conditions: []string{fmt.Sprintf("%s == \"1\"", limitIdentifier)}, | |||
Conditions: []string{fmt.Sprintf("descriptors[0][\"%s\"] == \"1\"", limitIdentifier)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes I remember seeing this in the limitador PR I approved but didn't connect the dots here
With Limitador v2.0, conditions need to specify where the variables are to be looked up. Variables coming from the envoy RLP are populated in the
descriptors
root binding. While the protocol allows for multiple descriptors (each with multiple entries), the wasm-shim will only ever use the first one, i.e. index 0.Fixes #1144